Microprocessor-based controllers are commonly used to generate pulse-width-modulation (PWM) output signals for control or communication purposes, and frequently include one or more output ports specifically designed to perform this task. In a typical arrangement, the microprocessor includes a multiple-stage free-running counter operating at a predefined clock frequency, and the PWM output port includes a register for temporary storage of a PWM on or off interval and comparator circuitry or software for comparing the counter value to the value of the PWM data stored in the register. The port can be configured by the system software to change the logic level of its PWM output when the comparison yields a match, and to generate an interrupt request triggering the system software to re-load the register with the next PWM data value.
A limitation of the above-described arrangement is that the controller is unable to generate the long periods of a low frequency PWM signal. Suppose, for example, that the base counter frequency is 100 Hz, so that the counter overflows every 10 msec. If the controller is required to generate a PWM output at a lower frequency, the on or off interval of the required PWM signal may exceed the period of the counter, rendering the usual PWM generation method ineffective.